import request from '@/api/request'

// 获取联想建议（自动补全）
export function getSuggestionListApi(param) {
  return request({
    method: "GET",
    url: "/app/v1_0/suggestion",
    params: {
      'q': param//联想建议关键词
    }
  })
}

// 获取搜索结果
export function getSearchResultApi(page,per_page,q) {
  return request({
    method: "GET",
    url: "/app/v1_0/search",
    params: {
      "page":	page,
      "per_page":	per_page,
      "q": q
    }
  })
}

//获取用户搜索历史
export function getSearchHistoryApi() {
  return request({
    method: "GET",
    url: "/app/v1_0/search/histories"
  })
}

// 删除用户搜索历史
export function clearSearchHistoryApi() {
  return request({
    method: "DELETE",
    url: "/app/v1_0/search/histories"
  })
}